﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace SimpleTaskManager.WebUI.Models
{
    /// <summary>
    /// Class that helps in used to later create object of WorkingHoursEntry class
    /// </summary>
    public class WorkingHoursModel
    {
        /// <summary>
        /// ID of WorkingHoursEntry object that we want to edit (0 or null for new object)
        /// </summary>
        public int WorkingHoursEntryID { get; set; }

        /// <summary>
        /// UserID of a user for which we want to add/modify the entry
        /// </summary>
        public int UserID { get; set; }

        /// <summary>
        /// TaskID of a task on which the employee was working
        /// </summary>
        [Display(Name = "Task")]
        [Required(ErrorMessage = "Please choose the task")]
        public int TaskID { get; set; }

        /// <summary>
        /// Date of employee's working hours
        /// </summary>
        [Display(Name = "Date")]
        [DataType(DataType.Date)]
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [Required(ErrorMessage = "Please enter a date")]
        public DateTime Date { get; set; }

        /// <summary>
        /// Number of hours the employee spend on certain task on given day
        /// </summary>
        [Display(Name = "Hours")]
        [Required(ErrorMessage = "Please enter number of hours")]
        public int Hours { get; set; }

        /// <summary>
        /// List of tasks which are currently available for the user
        /// </summary>
        public SelectList UserTasks { get; set; }
    }
}